package com.skyhigh.web.webservice.domain;

// Generated 26/03/2012 11:56:15 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import org.hibernate.annotations.Proxy;

/**
 * Patio generated by hbm2java
 */
@Entity
@Table(name = "patio", catalog = "proyecto_metodologia")
@TableGenerator(name="generatorName", 
table="secuencia",  
pkColumnName="codigo",  
pkColumnValue = "Patio.id",
valueColumnName="valor",  
allocationSize=100)
@Proxy( lazy=false )
public class Patio implements java.io.Serializable {

	private int idPatio;
	private Planta planta;
	private CategoriaMercaderia categoriaMercaderia;
	private Set<Contenedor> contenedors = new HashSet<Contenedor>(0);

	public Patio() {
	}

	public Patio(int idPatio, Planta planta,
			CategoriaMercaderia categoriaMercaderia) {
		this.idPatio = idPatio;
		this.planta = planta;
		this.categoriaMercaderia = categoriaMercaderia;
	}

	public Patio(int idPatio, Planta planta,
			CategoriaMercaderia categoriaMercaderia, Set<Contenedor> contenedors) {
		this.idPatio = idPatio;
		this.planta = planta;
		this.categoriaMercaderia = categoriaMercaderia;
		this.contenedors = contenedors;
	}

	@Id
	@Column(name = "idPatio", unique = true, nullable = false)
	@GeneratedValue(strategy=GenerationType.TABLE, generator="generatorName")
	public int getIdPatio() {
		return this.idPatio;
	}

	public void setIdPatio(int idPatio) {
		this.idPatio = idPatio;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idPlanta", nullable = false)
	public Planta getPlanta() {
		return this.planta;
	}

	public void setPlanta(Planta planta) {
		this.planta = planta;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idCategoriaMercaderia", nullable = false)
	public CategoriaMercaderia getCategoriaMercaderia() {
		return this.categoriaMercaderia;
	}

	public void setCategoriaMercaderia(CategoriaMercaderia categoriaMercaderia) {
		this.categoriaMercaderia = categoriaMercaderia;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "patio")
	public Set<Contenedor> getContenedors() {
		return this.contenedors;
	}

	public void setContenedors(Set<Contenedor> contenedors) {
		this.contenedors = contenedors;
	}

}
